/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.chapter5.designpatters.creationpatterns.singleton.singletonimpl;

import java.util.Date;

/**
 *
 * @author Sakhe
 */
public class Singleton {
private static Singleton theOnlyOne;
private Date d = new Date() ;
private Singleton() {
    
}

    public synchronized static Singleton instance ( ) {
    if(theOnlyOne == null ) {
    theOnlyOne = new Singleton() ;
    }
    return theOnlyOne;
    }
    
    public Date getDate() {
    return d ;
    }
    
}
